package com.itheima.pojo;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import lombok.Data;

import java.util.*;

@Data
public class Flows {
    private String type;
    private String notes;
    private String procInsId;
    private String roleType;
    private String projectId;
    private String subItemId;
    private String bussinessId;
    private String performerId;
    private String projectName;
    private String subItemName;
    private String flowHandleId;


     private    Map<String,List<RoleList>> users=new LinkedHashMap<>();
           @Data
       public   static   class RoleList{
               private String uid;
               private String userName;
               private String majId;
               private String majName;
           }

    public static void main(String[] args) {
/*
        Flows flows = new Flows();
        flows.setType("incape");
        flows.setNotes("hahah");

        RoleList roleList = flows.new RoleList();

        roleList.setMajId("1");
        List<RoleList> lists=new ArrayList<>();
        lists.add(roleList);
        Map<String,List<RoleList>> users=new LinkedHashMap<>();
        users.put("faqi",lists);
         flows.setUsers(users);


        Gson gson=new Gson();
        String toJson = gson.toJson(flows);
        System.out.println(toJson);
*/



String json="{\"type\":\"results_confirm\",\"notes\":\"审批意见\",\"users\":{\"faqiren\":[{\"uid\":\"7\",\"roleKey\":\"zhuanye_fuze_ren\"}],\"tuDangList\":[{\"uid\":\"63\",\"roleKey\":\"zhuanye_fuze_ren\",\"userName\":\"佘颖\"}],\"fuzerenList\":[{\"uid\":\"21\",\"roleKey\":\"zhuanye_fuze_ren\"}]},\"roleType\":\"faqiren\",\"procInsId\":\"\",\"projectId\":\"-1\",\"subItemId\":\"\",\"bussinessId\":\"400\",\"performerId\":429210515106955260,\"projectName\":\"国贸cbd\",\"subItemName\":\"子项1 \",\"flowHandleId\":\"1\"}";

   json="{\"type\":\"results_confirm\",\"notes\":\"审批意见\",\"users\":{\"faqiren\":[{\"uid\":\"7\",\"depId\":null,\"depKey\":null,\"roleId\":null,\"nodeNum\":null,\"roleKey\":\"zhuanye_fuze_ren\",\"userName\":\"佘颖\",\"operateType\":null}],\"tuDangList\":[{\"uid\":\"63\",\"depId\":null,\"depKey\":null,\"roleId\":null,\"nodeNum\":null,\"roleKey\":\"zhuanye_fuze_ren\",\"userName\":\"佘颖\",\"operateType\":null}],\"fuzerenList\":[{\"uid\":\"21\",\"depId\":null,\"depKey\":null,\"roleId\":null,\"nodeNum\":null,\"roleKey\":\"zhuanye_fuze_ren\",\"userName\":\"佘颖\",\"operateType\":null}],\"huiqianList\":[{\"uid\":\"62\",\"depId\":null,\"depKey\":null,\"roleId\":null,\"nodeNum\":null,\"roleKey\":\"zhuanye_fuze_ren\",\"userName\":\"佘颖\",\"operateType\":null}],\"shejirenList\":[{\"uid\":\"61\",\"depId\":null,\"depKey\":null,\"roleId\":null,\"nodeNum\":null,\"roleKey\":\"zhuanye_fuze_ren\",\"userName\":\"佘颖\",\"operateType\":null}],\"shenherenList\":[{\"uid\":\"41\",\"depId\":null,\"depKey\":null,\"roleId\":null,\"nodeNum\":null,\"roleKey\":\"zhuanye_fuze_ren\",\"userName\":\"佘颖\",\"operateType\":null}],\"xiaoduirenList\":[{\"uid\":\"31\",\"depId\":null,\"depKey\":null,\"roleId\":null,\"nodeNum\":null,\"roleKey\":\"zhuanye_fuze_ren\",\"userName\":\"佘颖\",\"operateType\":null}],\"shendingrenList\":[{\"uid\":\"51\",\"depId\":null,\"depKey\":null,\"roleId\":null,\"nodeNum\":null,\"roleKey\":\"zhuanye_fuze_ren\",\"userName\":\"佘颖\",\"operateType\":null}],\"shejizhuchirenList\":[{\"uid\":\"61\",\"depId\":null,\"depKey\":null,\"roleId\":null,\"nodeNum\":null,\"roleKey\":\"zhuanye_fuze_ren\",\"userName\":\"佘颖\",\"operateType\":null}]},\"roleType\":\"faqiren\",\"procInsId\":\"\",\"projectId\":\"-1\",\"subItemId\":\"\",\"bussinessId\":\"400\",\"performerId\":429210515106955260,\"projectName\":\"国贸cbd\",\"subItemName\":\"子项1 \",\"flowHandleId\":\"1\"}";
  json="{\"type\":\"results_confirm\",\"notes\":\"审批意见\",\"users\":{\"faqiren\":{\"uid\":\"7\",\"depId\":null,\"depKey\":null,\"roleId\":null,\"nodeNum\":null,\"roleKey\":\"zhuanye_fuze_ren\",\"userName\":\"佘颖\",\"operateType\":null},\"tuDangList\":[{\"uid\":\"63\",\"depId\":null,\"depKey\":null,\"roleId\":null,\"nodeNum\":null,\"roleKey\":\"zhuanye_fuze_ren\",\"userName\":\"佘颖\",\"operateType\":null}],\"fuzerenList\":[{\"uid\":\"21\",\"depId\":null,\"depKey\":null,\"roleId\":null,\"nodeNum\":null,\"roleKey\":\"zhuanye_fuze_ren\",\"userName\":\"佘颖\",\"operateType\":null}],\"huiqianList\":[{\"uid\":\"62\",\"depId\":null,\"depKey\":null,\"roleId\":null,\"nodeNum\":null,\"roleKey\":\"zhuanye_fuze_ren\",\"userName\":\"佘颖\",\"operateType\":null}],\"shejirenList\":[{\"uid\":\"61\",\"depId\":null,\"depKey\":null,\"roleId\":null,\"nodeNum\":null,\"roleKey\":\"zhuanye_fuze_ren\",\"userName\":\"佘颖\",\"operateType\":null}],\"shenherenList\":[{\"uid\":\"41\",\"depId\":null,\"depKey\":null,\"roleId\":null,\"nodeNum\":null,\"roleKey\":\"zhuanye_fuze_ren\",\"userName\":\"佘颖\",\"operateType\":null}],\"xiaoduirenList\":[{\"uid\":\"31\",\"depId\":null,\"depKey\":null,\"roleId\":null,\"nodeNum\":null,\"roleKey\":\"zhuanye_fuze_ren\",\"userName\":\"佘颖\",\"operateType\":null}],\"shendingrenList\":[{\"uid\":\"51\",\"depId\":null,\"depKey\":null,\"roleId\":null,\"nodeNum\":null,\"roleKey\":\"zhuanye_fuze_ren\",\"userName\":\"佘颖\",\"operateType\":null}],\"shejizhuchirenList\":[{\"uid\":\"61\",\"depId\":null,\"depKey\":null,\"roleId\":null,\"nodeNum\":null,\"roleKey\":\"zhuanye_fuze_ren\",\"userName\":\"佘颖\",\"operateType\":null}]},\"roleType\":\"faqiren\",\"procInsId\":\"\",\"projectId\":\"-1\",\"subItemId\":\"\",\"bussinessId\":\"400\",\"performerId\":429210515106955260,\"projectName\":\"国贸cbd\",\"subItemName\":\"子项1 \",\"flowHandleId\":\"1\"}";
json="{\"type\":\"incape\",\"notes\":\"hahah\",\"users\":{\"role\":{\"faqorem\":[{\"majId\":\"1\",\"majName\":\"hahha\"}]}}}";

json="{\"type\":\"incape\",\"notes\":\"hahah\",\"users\":{\"faqi\":[{\"majId\":\"1\"}]}}";

json="{\"type\":\"results_confirm\",\"notes\":\"审批意见\",\"users\":{\"faqiren\":[{\"uid\":\"7\",\"depId\":null,\"depKey\":null,\"roleId\":null,\"nodeNum\":null,\"roleKey\":\"zhuanye_fuze_ren\",\"userName\":\"佘颖\",\"operateType\":null}],\"tuDangList\":[{\"uid\":\"63\",\"depId\":null,\"depKey\":null,\"roleId\":null,\"nodeNum\":null,\"roleKey\":\"zhuanye_fuze_ren\",\"userName\":\"佘颖\",\"operateType\":null}],\"fuzerenList\":[{\"uid\":\"21\",\"depId\":null,\"depKey\":null,\"roleId\":null,\"nodeNum\":null,\"roleKey\":\"zhuanye_fuze_ren\",\"userName\":\"佘颖\",\"operateType\":null}],\"huiqianList\":[{\"uid\":\"62\",\"depId\":null,\"depKey\":null,\"roleId\":null,\"nodeNum\":null,\"roleKey\":\"zhuanye_fuze_ren\",\"userName\":\"佘颖\",\"operateType\":null}],\"shejirenList\":[{\"uid\":\"61\",\"depId\":null,\"depKey\":null,\"roleId\":null,\"nodeNum\":null,\"roleKey\":\"zhuanye_fuze_ren\",\"userName\":\"佘颖\",\"operateType\":null}],\"shenherenList\":[{\"uid\":\"41\",\"depId\":null,\"depKey\":null,\"roleId\":null,\"nodeNum\":null,\"roleKey\":\"zhuanye_fuze_ren\",\"userName\":\"佘颖\",\"operateType\":null}],\"xiaoduirenList\":[{\"uid\":\"31\",\"depId\":null,\"depKey\":null,\"roleId\":null,\"nodeNum\":null,\"roleKey\":\"zhuanye_fuze_ren\",\"userName\":\"佘颖\",\"operateType\":null}],\"shendingrenList\":[{\"uid\":\"51\",\"depId\":null,\"depKey\":null,\"roleId\":null,\"nodeNum\":null,\"roleKey\":\"zhuanye_fuze_ren\",\"userName\":\"佘颖\",\"operateType\":null}],\"shejizhuchirenList\":[{\"uid\":\"61\",\"depId\":null,\"depKey\":null,\"roleId\":null,\"nodeNum\":null,\"roleKey\":\"zhuanye_fuze_ren\",\"userName\":\"佘颖\",\"operateType\":null}]},\"roleType\":\"faqiren\",\"procInsId\":\"\",\"projectId\":\"-1\",\"subItemId\":\"\",\"bussinessId\":\"400\",\"performerId\":429210515106955260,\"projectName\":\"国贸cbd\",\"subItemName\":\"子项1 \",\"flowHandleId\":\"1\"}";

 json="{\"type\":\"results_confirm\",\"notes\":\"审批意见\",\"users\":{\"faqiren\":[{\"uid\":\"7\",\"depId\":null,\"depKey\":null,\"roleId\":null,\"nodeNum\":null,\"roleKey\":\"zhuanye_fuze_ren\",\"userName\":\"佘颖\",\"operateType\":null}],\"tuDangList\":[{\"uid\":\"63\",\"depId\":null,\"depKey\":null,\"roleId\":null,\"nodeNum\":null,\"roleKey\":\"zhuanye_fuze_ren\",\"userName\":\"佘颖\",\"operateType\":null},{\"uid\":\"64\",\"depId\":null,\"depKey\":null,\"roleId\":null,\"nodeNum\":null,\"roleKey\":\"zhuanye_fuze_ren\",\"userName\":\"佘颖12\",\"operateType\":null}],\"fuzerenList\":[{\"uid\":\"21\",\"depId\":null,\"depKey\":null,\"roleId\":null,\"nodeNum\":null,\"roleKey\":\"zhuanye_fuze_ren\",\"userName\":\"佘颖\",\"operateType\":null}],\"huiqianList\":[{\"uid\":\"62\",\"depId\":null,\"depKey\":null,\"roleId\":null,\"nodeNum\":null,\"roleKey\":\"zhuanye_fuze_ren\",\"userName\":\"佘颖\",\"operateType\":null}],\"shejirenList\":[{\"uid\":\"61\",\"depId\":null,\"depKey\":null,\"roleId\":null,\"nodeNum\":null,\"roleKey\":\"zhuanye_fuze_ren\",\"userName\":\"佘颖\",\"operateType\":null}],\"shenherenList\":[{\"uid\":\"41\",\"depId\":null,\"depKey\":null,\"roleId\":null,\"nodeNum\":null,\"roleKey\":\"zhuanye_fuze_ren\",\"userName\":\"佘颖\",\"operateType\":null}],\"xiaoduirenList\":[{\"uid\":\"31\",\"depId\":null,\"depKey\":null,\"roleId\":null,\"nodeNum\":null,\"roleKey\":\"zhuanye_fuze_ren\",\"userName\":\"佘颖\",\"operateType\":null}],\"shendingrenList\":[{\"uid\":\"51\",\"depId\":null,\"depKey\":null,\"roleId\":null,\"nodeNum\":null,\"roleKey\":\"zhuanye_fuze_ren\",\"userName\":\"佘颖\",\"operateType\":null}],\"shejizhuchirenList\":[{\"uid\":\"61\",\"depId\":null,\"depKey\":null,\"roleId\":null,\"nodeNum\":null,\"roleKey\":\"zhuanye_fuze_ren\",\"userName\":\"佘颖\",\"operateType\":null}]},\"roleType\":\"faqiren\",\"procInsId\":\"\",\"projectId\":\"-1\",\"subItemId\":\"\",\"bussinessId\":\"400\",\"performerId\":429210515106955260,\"projectName\":\"国贸cbd\",\"subItemName\":\"子项1 \",\"flowHandleId\":\"1\"}";

 json="{\"type\":\"results_confirm\",\"notes\":\"审批意见\",\"procInsId\":\"\",\"roleType\":\"faqiren\",\"projectId\":\"-1\",\"subItemId\":\"\",\"bussinessId\":\"400\",\"performerId\":\"429210515106955260\",\"projectName\":\"国贸cbd\",\"subItemName\":\"子项1 \",\"flowHandleId\":\"1\",\"users\":{\"PrjManager\":[{\"uid\":\"7\",\"userName\":\"佘颖\"}],\"PrLeader\":[{\"uid\":\"63\",\"userName\":\"佘颖\"},{\"uid\":\"64\",\"userName\":\"佘颖12\"}],\"SysteManager\":[{\"uid\":\"21\",\"userName\":\"佘颖\"}],\"MainDepManager\":[{\"uid\":\"62\",\"userName\":\"佘颖\"}],\"Dean\":[{\"uid\":\"61\",\"userName\":\"佘颖\"}],\"shenherenList\":[{\"uid\":\"41\",\"userName\":\"佘颖\"}],\"Initiator\":[{\"uid\":\"31\",\"userName\":\"佘颖\"}],\"ProjectPersonnel\":[{\"uid\":\"51\",\"userName\":\"佘颖\"}],\"ChapterPersonnel\":[{\"uid\":\"61\",\"userName\":\"佘颖\"}],\"InfoOfficePersonnel\":[{\"uid\":\"61\",\"userName\":\"佘颖\"}]}}";

 Gson gson=new Gson();
 Flows flows2= gson.fromJson(json, new TypeToken<Flows>(){}.getType());
 System.out.println(flows2);


        String toJson = gson.toJson(flows2);
        System.out.println("toJson::"+toJson);



    }
}

